package com.leo.parallelarray;

import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;

/**
 *
 * @author xuexiaolei
 * @version 2018年01月11日
 */
public class Test {
    public static void main(String[] args) {
        long[] arrays = new long[2000];
        Arrays.parallelSetAll(arrays, index -> ThreadLocalRandom.current().nextInt(10000));

        Arrays.stream(arrays).limit(10).forEach(i -> System.out.print(i+"   "));
        System.out.println();

        Arrays.parallelSort(arrays);
        Arrays.stream(arrays).limit(10).forEach(i -> System.out.print(i+"   "));
        System.out.println();

    }
}
